//
// Created by liushuai on 2020/2/13.
//
#include "isAnagram.h"
<<<<<<< HEAD:cxx/algorithm/src/isAnagram.cc
map<char,int> count(string s){
    map<char,int> result;
    for(auto elem:s){
        if(result.count(elem)){
            result[elem] += 1;
        }else{
            result[elem] =1;
        }
    }
    return result;
}
bool isAnagram(string s,string t){
    if(t.size()!=s.size())
        return false;
    else{
        map<char,int> sMap = count(s);
        map<char,int> tMap = count(t);
        if(sMap == tMap)
            return true;
        else
            return false;
    }
=======
map<char, int> count(string s) {
  map<char, int> result;
  for (auto elem : s) {
    if (result.count(elem)) {
      result[elem] += 1;
    } else {
      result[elem] = 1;
    }
  }
  return result;
}
bool isAnagram(string s, string t) {
  if (t.size() != s.size())
    return false;
  else {
    map<char, int> sMap = count(s);
    map<char, int> tMap = count(t);
    if (sMap == tMap)
      return true;
    else
      return false;
  }
>>>>>>> dev:cxx/algorithm/common/src/isAnagram.cc
}